<template>
  <div class="boa">
    <!-- 商机区域 -->
    <Head title="商 机" id="backstyle"></Head>
    <Banner :id="bannerId" class="bannerId"></Banner>
    <!-- 版心区域 -->
    <div class="text title-center tac l-h">
      {{ this.$route.query.title }}
    </div>
    <!-- 商机总区域 -->
    <div class="top" v-if="list.length">
      <!-- 用户单位文字区域 -->
      <div class="umit bold-size">
        <div class="war">
          <div class="area-center title-center">
            <div
              class="xiao m-t-07"
              v-for="(item, index) in list"
              :key="index"
              @click="applet"
            >
              <div class="left">{{ index + 1 }}.</div>
              <div class="zhong">{{ item.name }}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div v-else class="bold-size tac c999 m-t-20">暂无数据</div>
  </div>
</template>

<script>
import { getFather } from "@/api/index";
import Head from "@/components/public/HeadPage.vue";
import Banner from "@/components/Home/BannerView.vue";
export default {
  data() {
    return {
      list: "",
    };
  },
  components: {
    Head,
    Banner,
  },
  mounted() {
    let data = {
      provincial: this.$route.query.citysub,
      id: this.$route.query.id,
    };
    // if (this.$route.query.id == "海外名茶") {
    if (this.$route.query.title == "海外名酒") {
      this.teacontext = true;
      getFather(
        (data = {
          // top: "top",
          provincial: "海外",
          id: this.$route.query.id,
        })
      ).then((res) => {
        if (res.data.code == 200) {
          this.list = res.data.data;
        }
      });
    } else {
      this.teacontext = false;
      getFather(data).then((res) => {
        if (res.data.code == 200) {
          this.list = res.data.data;
        }
      });
    }
  },
  computed: {
    bannerId() {
      switch (this.$route.query.id) {
        // 名茶
        case "f7a84efa-274a-49de-8bf4-b30fd66cfd61":
          return "7";
        // 名酒
        case "57f93baf-975d-414b-a170-ac66c2a22277":
          return "10";
        default:
          break;
      }
    },
  },
  methods: {
    applet() {
      this.$router.push({ path: "/applet" });
    },
  },
};
</script>

<style scoped>
.boa {
  width: 100%;
  height: 6rem;
}
/* 图标区域 */
.top img {
  width: 0.24rem;
  margin-right: 0.05rem;
}

/* 商机总区域 */
.top {
  width: 100%;
}

/* 用人单位区域 */
.umit {
  width: 100%;
  min-height: 0.4rem;
  border-radius: 0.1rem;
}
.xiao {
  width: 100%;

  display: flex;
  align-items: center;
}
/* 左边区域 */
.left {
  width: 0.1rem;
  margin: -0.02rem 0 0 0.1rem;
}

/* 中间区域 */
.zhong {
  width: 95%;
  height: 100%;
  line-height: 0.3rem;
  padding-left: 0.1rem;
}
h2 {
  width: 100%;
  height: 5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>